package com.kuang.service;

import com.kuang.dao.StockMapper;
import com.kuang.pojo.Stock;

import java.util.List;

public class StockServiceImpl  implements StockService{
    private StockMapper stockMapper;

    public void setStockMapper(StockMapper stockMapper) {
        this.stockMapper = stockMapper;
    }

    @Override
    public List<Stock> getStock() {
        return stockMapper.getStock();
    }

    @Override
    public int addStock(Stock stock) {
        return stockMapper.addStock(stock);
    }

    @Override
    public Stock getStockById(String id) {
        return stockMapper.getStockById(id);
    }

    @Override
    public int updateStock(Stock stock) {
        return stockMapper.updateStock(stock);
    }

    @Override
    public int deleteStock(String id) {
        return stockMapper.deleteStock(id);
    }

    @Override
    public List<Stock> getStockByName(String name) {
        return stockMapper.getStockByName(name);
    }
}
